package com.yunkuhui.www.demo.filter;


import org.springframework.stereotype.Component;

import javax.servlet.*;
import java.io.IOException;

@Component
public class DefaultFilter implements Filter {

	@Override
	public void doFilter(ServletRequest req, ServletResponse res, FilterChain chain) throws IOException,
			ServletException {
		String localAddr = req.getLocalAddr();
		int serverPort = req.getServerPort();
		System.out.println("DefaultFilter过滤localAddr：" + localAddr);
		System.out.println("DefaultFilter过滤serverPort：" + serverPort);
		chain.doFilter(req, res);
	}
}
